package social.hub.twitter;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

import java.util.List;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import social.hub.twitter.TwitterClient;
import social.hub.twitter.TwitterClientImpl;
import social.hub.twitter.TwitterProfile;

public class ITTwitterClientImpl {

	private TwitterClient	client;

	@Before
	public void setUp() throws Exception {

		final String apiKey = "FHWExNfm2mvTHfIErdKg";
		final String apiSecret = "mWKacnA3wfrNJTCRC3AQvLzxJk1C18fzoIdH68lspU";
		final String accessToken = "208691711-lIP1zqE67kb8n02qKg9My7zbub3Rxs0yvps8QmvU";
		final String accessTokenSecret = "SYD3CWZY74WLjqMDHfkq5He9QwVg52keyprBLhlpo";

		client = new TwitterClientImpl(apiKey, apiSecret, accessToken, accessTokenSecret);

	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testGetFollowers() {

		int esperado = 3;

		final List<TwitterProfile> friends = client.getFollowers();

		assertEquals(esperado, friends.size());

	}

	@Test
	public void testGetFollowersLong() {

		Long profileId = 185854856L;
		int esperado = 3;

		final List<TwitterProfile> friends = client.getFollowers(profileId);

		assertEquals(esperado, friends.size());

	}

	@Test
	public void testGetFriends() {

		int esperado = 3;

		final List<TwitterProfile> friends = client.getFriends();

		assertEquals(esperado, friends.size());

	}

	@Test
	public void testGetFriendsLong() {

		Long profileId = 185854856L;
		int esperado = 3;

		final List<TwitterProfile> friends = client.getFriends(profileId);

		assertEquals(esperado, friends.size());

	}

	@Test
	public void testGetFriendsTimeline() {
		fail("Not yet implemented");
	}

	@Test
	public void testGetHomeTimeline() {
		fail("Not yet implemented");
	}

	@Test
	public void testGetPublicTimeline() {
		fail("Not yet implemented");
	}

	@Test
	public void testGetUserId() {

		Long esperado = 185854856L;

		final Long userId = client.getUserId();

		assertEquals(esperado, userId);

	}

	@Test
	public void testGetUserProfile() {

		Long esperado = 185854856L;

		final TwitterProfile user = client.getUserProfile();

		assertEquals(esperado, user.getId());

	}

	@Test
	public void testGetUserProfileLong() {

		Long profileId = 185854856L;

		final TwitterProfile user = client.getUserProfile(profileId);

		assertEquals(profileId, user.getId());

	}

	@Test
	public void testGetUserTimeline() {
		fail("Not yet implemented");
	}

	@Test
	public void testGetUserTimelineLong() {
		fail("Not yet implemented");
	}

	@Test
	public void testRetweet() {
		fail("Not yet implemented");
	}

	@Test
	public void testSendDirectMessage() {
		fail("Not yet implemented");
	}

	@Test
	public void testUpdateStatus() {
		client.updateStatus("Teste Integração Twitter");
	}

}
